Codex/fix 48h review findings#574
Conversation
…findings # Conflicts: # docs/branch-review-ledger.md # src/lib/rag-extractive-answer.ts # tests/bounded-json-body.test.ts # tests/private-access-routes.test.ts # tests/source-backed-recovery-cross-reference.test.ts
Docstrings generation was requested by @BigSimmo. * #550 (comment) The following files were modified: * `src/app/layout.tsx` * `src/components/DocumentViewer.tsx` * `src/lib/api-rate-limit.ts` * `src/lib/document-viewer-navigation.ts` * `src/lib/metadata-base.ts` * `src/lib/public-api-access.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
@copilot resolve the merge conflicts in this pull request |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes add request-aware metadata origin resolution, centralize document page URL construction, extend anonymous upload quotas, revise proxy-based identity derivation, and align UI smoke tests with scoped session storage and updated controls. ChangesApplication behavior updates
🚥 Pre-merge checks | ✅ 8 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (8 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/document-viewer-navigation-source.test.ts (1)
13-19: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider covering negative/decimal page inputs.
Current tests cover
0,NaN, and+Infinity, but not a negative finite value (e.g.-5) or a decimal (e.g.2.7), which exercise theMath.max/Math.truncbranches differently.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/document-viewer-navigation-source.test.ts` around lines 13 - 19, Add cases to the “normalizes invalid page numbers to the first page” test for a negative finite input such as -5 and a decimal input such as 2.7, asserting the expected normalized URLs and covering the Math.max and Math.trunc behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/layout.tsx`:
- Around line 35-45: Update generateMetadata so headers() is only awaited when
NODE_ENV is not production, matching the allowRequestOrigin condition; pass the
resulting headers value to resolveMetadataBase only in that development path
while preserving static production rendering and existing metadata behavior.
---
Nitpick comments:
In `@tests/document-viewer-navigation-source.test.ts`:
- Around line 13-19: Add cases to the “normalizes invalid page numbers to the
first page” test for a negative finite input such as -5 and a decimal input such
as 2.7, asserting the expected normalized URLs and covering the Math.max and
Math.trunc behavior.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b0abf075-782c-4b23-860e-c690e6cc6664
📒 Files selected for processing (13)
.env.examplesrc/app/layout.tsxsrc/components/DocumentViewer.tsxsrc/lib/api-rate-limit.tssrc/lib/document-viewer-navigation.tssrc/lib/metadata-base.tssrc/lib/public-api-access.tstests/api-rate-limit-fallback.test.tstests/document-viewer-navigation-source.test.tstests/production-metadata-source.test.tstests/public-api-access.test.tstests/ui-smoke.spec.tstests/ui-tools-collapse.spec.ts
Resolved in |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Summary
Verification
npm run verify:pr-localDuring development, use
npm run verify:cheapas the faster iteration gate before the final PR-local preflight.npm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changednpm run verify:releasebefore release or handoff confidence claimsFor retrieval, ranking, selection, chunking, source/citation rendering, or answer-contract changes,
verify:pr-localrunseval:rag:offlineautomatically. Run the offline command directly during iteration before spending a live eval.npm run eval:retrieval:quality(must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed — CI cannot run it (needs live keys), so run it locally and paste the summary. A metadata/governance-weighting change once buried correct docs (recall 1.0→0.76) and only this eval caught it.npm run eval:rag -- --limit 15+npm run eval:quality -- --rag-onlywhen answer generation, the synthesis prompt, or answer post-processing changed (grounded-supported must not drop; citation-failure 0)npm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changednpm run check:deployment-readinesswhen deployment startup, hosting, or rollout behavior changedClinical Governance Preflight
Complete this section when the change touches ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes